﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ccform从表设计器</title>
    <link href="../../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../Comm/Style/Table0.css" rel="stylesheet" type="text/css" />
    <link href="../../Comm/Style/Tabs.css" rel="stylesheet" type="text/css" />

    <script language="JavaScript" src="../../Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../Comm/Gener.js" type="text/javascript"></script>
    <script src="../../Scripts/EasyUIUtility.js" type="text/javascript"></script>
    <base target="_self" />

      <script type="text/javascript">
          function Esc() {
              if (event.keyCode == 27)
                  window.close();
              return true;
          }

          //公共变量.
          //表单ID.
          var fk_mapData = GetQueryString("FK_MapData");
          //明细表ID.
          var fk_mapDtl = GetQueryString("FK_MapDtl");
          //所属表单id
          var fk_node = GetQueryString("FK_Node");

          var isFor = GetQueryString("For");

          var url = 'MapDtlDe.htm?DoType=Edit&FK_MapData=' + fk_mapData + '&FK_MapDtl=' + fk_mapDtl + "&For=" + isFor + "&m=" + Math.random();

          $(function () {

              $("#F").attr("src", url);

              if (isFor != null || isFor != undefined) {

                  $("#DtlAttr").html(isFor);
                  return;
                  // $("#DtlAttr").hide();
                  //document.getElementById("DtlAttr").style = "";
              }


              var handler = new HttpHandler("BP.WF.HttpHandler.WF_Admin_FoolFormDesigner");
              handler.AddUrlData();
              var data = handler.DoMethodReturnString("MapDefDtlFreeFrm_Init");


              if (data.indexOf('err@') == 0) {
                  alert(data);
                  return;
              }

              if (data.indexOf("sln@") != -1 && isFor == false) {
                  var slnDtlNo = data.substr("sln@".length);
                  location.href = "MapDefDtlFreeFrm.htm?FK_MapDtl=" + slnDtlNo + "&FK_MapData=Temp&For=" + GetQueryString("For") + "&t=" + Math.random();
              }

          });

          function HelpGroup() {
              var msg = '字段分组：就是把类似的字段放在一起，让用户操作更友好。\t\n比如：我们纳税人设计一个基础信息采集节点。';
              msg += '在登记纳税人基础信息时，我们可以把基础信息、车船信息、房产信息、投资人信息分组。\t\n \t\n分组的格式为:@从字段名称1=分组名称1@从字段名称2=分组名称2 ,\t\n比如：节点信息设置，@NodeID=基本信息@LitData=考核信息。';
              alert(msg);
          }

          //主表存储表为数据库表时，从表的字段也不能自动创建
          function AddF(fk_mapdata) {
              var mapDtl = new Entity("BP.Sys.MapDtl", fk_mapdata);
              var mapData = new Entity("BP.Sys.MapData", mapDtl.FK_MapData);
              var url = 'FieldTypeList.htm?FK_MapData=' + fk_mapdata + '&inlayer=1&s=' + Math.random();
              if (mapData != null && mapData.PTableModel == 2)
                  url = 'FieldTypeListChoseOneField.htm?FK_MapData=' + fk_mapdata + '&inlayer=1&s=' + Math.random();
              OpenEasyUiDialog(url, "eudlgframe", "插入列", 800, 500, "icon-edit", true, null, null, null, function () {
                  ReloadDtlFrame();
              });
          }

          function HidAttr(mypk) {
              var url = 'HidAttr.htm?FK_MapData=' + mypk;
              var b = window.showModalDialog(url, 'ass', 'dialogHeight: 700px; dialogWidth: 900px;center: yes; help: no');
              window.location.href = window.location.href;
          }

          function Edit(mypk, ftype) {

              var url = '';
              var title = ''

              //普通字段类型.
              if (ftype == "1") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrString&inlayer=1&PKVal=" + mypk;
                  title = '字段String属性';
              }

              //数值字段类型.
              if (ftype == "2") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrNum&inlayer=1&PKVal=" + mypk;
                  title = '字段Int属性';
              }

              //数值字段类型.
              if (ftype == "3") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrNum&inlayer=1&PKVal=" + mypk;
                  title = '字段Float属性';
              }

              //数值字段类型.
              if (ftype == "5") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrNum&inlayer=1&PKVal=" + mypk;
                  title = '字段Double属性';
              }

              //数值字段类型.
              if (ftype == "8") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrNum&inlayer=1&PKVal=" + mypk;
                  title = '字段Moeny属性';
              }


              //日期类型date.
              if (ftype == "6") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrDT&inlayer=1&PKVal=" + mypk;
                  title = '字段Date属性';
              }

              //日期类型datetime.
              if (ftype == "7") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrDT&inlayer=1&PKVal=" + mypk;
                  title = '字段DateTime属性';
              }

              // boolen 类型.
              if (ftype == "4") {
                  url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrBoolen&inlayer=1&PKVal=" + mypk;
                  title = '字段Boolen属性';
              }

              if (url == '') {
                  alert('@没有判断的类型' + ftype);
                  return;
              }

              OpenEasyUiDialog(url, "eudlgframe", title, 800, 500, "icon-edit", true, null, null, null, function () {
                  window.location.href = window.location.href;
              });
          }

          function EditEnum(fk_mapdata, mypk, enumKey) {

              var url = '../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrEnum&inlayer=1&PKVal=' + mypk + '&s=' + Math.random();
              OpenEasyUiDialog(url, "eudlgframe", "编辑枚举字段", 800, 500, "icon-edit", true, null, null, null, function () {
                  ReloadDtlFrame();
              });
          }
          function EditTable(fk_mapdata, mypk, fk_sfTable) {

              var url = "../../Comm/En.htm?EnName=BP.Sys.FrmUI.MapAttrSFTable&inlayer=1&PKVal=" + mypk;
              OpenEasyUiDialog(url, "eudlgframe", "外键字段属性", 800, 500, "icon-edit", true, null, null, null, function () {
                  ReloadDtlFrame();
              });
          }
          //刷新.
          function ReloadDtlFrame() {
              window.location.href = window.location.href;
          }
          function Esc() {
              if (event.keyCode == 27)
                  window.close();
              return true;
          }

          var isInser = "";
          function EditDtl(fk_mapData, dtlKey) {

              var url = "../../Comm/En.htm?EnName=BP.WF.Template.MapDtlExt&PKVal=" + dtlKey;
              var W = document.body.clientWidth - 40;
              var H = document.body.clientHeight - 40;
              OpenEasyUiDialog(url, "eudlgframe", "设置", W, H, "icon-edit", true, null, null, null, function () {
                  window.location.href = window.location.href;
              });
          }

          function EditMapDtl(dtlKey) {

              var url = "../../Comm/En.htm?EnName=BP.WF.Template.MapDtlExt&inlayer=1&PKVal=" + dtlKey;

              OpenEasyUiDialog(url, "eudlgframe", "设置", 800, 500, "icon-edit", true, null, null, null, function () {
                  window.location.href = window.location.href;
              });
          }

          function closeDlg() {
              $("#eudlg").dialog("close");
          }

          //然浏览器最大化.
          function ResizeWindow() {
              if (window.screen) {  //判断浏览器是否支持window.screen判断浏览器是否支持screen     
                  var myw = screen.availWidth;   //定义一个myw，接受到当前全屏的宽     
                  var myh = screen.availHeight;  //定义一个myw，接受到当前全屏的高     
                  window.moveTo(0, 0);           //把window放在左上角     
                  window.resizeTo(myw, myh);     //把当前窗体的长宽跳转为myw和myh     
              }
          }
          window.onload = ResizeWindow;
         
     </script>
</head>
<body>

 <div class='easyui-layout' data-options='fit:true'>
        <div data-options="region:'north',noheader:true,split:false,border:false" style='height:30px;overflow-y:hidden'>
            <div style='float:left' id="DtlAttr">
                <a href="javascript:EditMapDtl(fk_mapDtl)" class='easyui-linkbutton' data-options="iconCls:'icon-edit',plain:true">属性</a>
            </div>
            <div style='float:right'>
                <a href="javascript:AddF(fk_mapDtl);" class='easyui-linkbutton' data-options="iconCls:'icon-new',plain:true">插入列</a>
                <a href="javascript:alert('将要取消');AddFGroup(fk_mapDtl);" class='easyui-linkbutton' data-options="iconCls:'icon-new',plain:true">插入列组</a>
            </div>
            <div style='clear:both'></div>
        </div>
        <div data-options="region:'center',noheader:true,border:false" style="overflow-y:hidden">
            <iframe id='F' frameborder='0' scrolling="auto" style='width:100%;height:400px' src='this.url'    ></iframe>
           <!-- <iframe id='Iframe1' frameborder='0' scrolling="auto" style='width:100%;height:100%' src='this.url'    ></iframe>-->

        </div>
    </div>

</body>
</html>
